package cn.kimming.wms.util;

import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSON;

public class JsonUtils {
	private JsonUtils() {}
	
	/**
	 * 由response对象返回JSON数据
	 */
	public static void putJSON(HttpServletResponse resp, Object data) {
		try {
			resp.setContentType("text/json;charset=UTF-8");
			resp.getWriter().print(JSON.toJSON(data));
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
}
